﻿using System;
using System.Data;

using BLL;


namespace EvaluationSystem
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                TesterInfoBLL TesterInfoBll = new TesterInfoBLL();
                BLL.RptBLL rptBLL = new BLL.RptBLL();

                int totalrecord = 0;

                BLL.TesterInfoBLL tbll = new TesterInfoBLL();
                DataSet ds = tbll.GetListByGuid(string.Empty);
                if (ds != null)
                {
                    totalrecord = ds.Tables[0].Rows.Count;
                    for (int i = 0; i < totalrecord; i++)
                    {
                        string guid = ds.Tables[0].Rows[i][0].ToString();
                        double score = rptBLL.GetTotalSocre(guid);

                        if(false == score.ToString().Equals("0"))
                        {
                            TesterInfoBll.UpdateTesterInfo(guid, "tester_matching", score.ToString());
                        }                        
                    }

                    Response.Write("Done!");
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message + ex.StackTrace);
            }
            
        }
    }
}